package com.liuyanzhao.blog.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.liuyanzhao.blog.entity.Message;
import com.liuyanzhao.blog.mapper.MessageMapper;
import com.liuyanzhao.blog.service.MessageService;

/**
 * 留言的服务层代码
 * @author jingtai sun
 * @Description: [完成留言的入、读取]
 * @CrateTime: 2019年6月23日
 */

public class MessageServiceImpl implements MessageService {

	@Autowired
	private MessageMapper messageMapper;
	
	/**
	 * 选择性插入留言（留言显示）
	 */
	@Override
	public int insertSelective(Message record) {
		int insert = messageMapper.insert(record);
		return insert;
	}

	/**
	 * 获取所有的留言并读入列表
	 */
	@Override
	public List<Message> selectAll() {
		List<Message> selectAll = messageMapper.selectAll();
		return selectAll;
	}

}
